package com.smart.manager.product.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.product.entities.enums.PigstyKind;
import com.smart.manager.product.entities.enums.PigstyStatus;
import com.smart.manager.product.entities.views.BasicPlaceView;
import io.ebean.annotation.DbArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.List;


/**
 * 游戏管理  猪圈管理
 * @author leo
 * @date 2023/09/05
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
@Table(name = "product_basic_pigsty")
public class BasicPigsty extends BaseLongModel {

    @ApiModelProperty("猪圈代码")
    private String code;

    @ApiModelProperty("猪圈名称")
    private String name;

    @ApiModelProperty("所属场地")
    @ManyToOne
    @JoinColumn(name = "place" ,referencedColumnName = "code")
    private BasicPlaceView place;

    @ApiModelProperty("猪圈类型")
    private PigstyKind kind;

    @ApiModelProperty("猪圈状态")
    private PigstyStatus status;

    @ApiModelProperty("是否有机")
    private Boolean isOrganic;

    @ApiModelProperty("容量")
    private int number;

    @ApiModelProperty("摄像头")
    @DbArray
    private List<String> cameraCode;

    @ApiModelProperty("摄像头地址")
    private transient List<String> cameraUrl;

    @ApiModelProperty("显示排序")
    private Integer sort;

}
